﻿using IM.Easy.Core.Audit;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.Entity.Gen
{
    [SugarTable]
    public class GenTable : AuditableEntity<Guid>
    {
        /// <summary>
        /// 表名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 所在库名
        /// </summary>
        public string? Schema { get; set; }

        /// <summary>
        /// 表的描述
        /// </summary>
        [SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
        public string? Desc { get; set; }

        /// <summary>
        /// 实体名称
        /// </summary>
        public string EntityName { get; set; }

        /// <summary>
        /// 作者
        /// </summary>
        public string? Author { get; set; }

        [Navigate(NavigateType.OneToMany, nameof(GenTableColumn.TableId))]
        public List<GenTableColumn> Columns { get; set; }

        /// <summary>
        /// 选项配置
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(Id), nameof(GenTableOption.TableId))]
        public GenTableOption Options { get; set; }
    }
}
